package com.hengpeng.itfin.domain.partner;

import com.hengpeng.itfin.domain.partner.chinapnr.ChinapnrProcessorImpl;
import com.hengpeng.itfin.domain.partner.fund.FundProcessorImpl;
import com.hengpeng.itfin.service.ServiceFactory;
import com.hengpeng.itfinbase.persist.Partner;

/**
 * <pre>
 * 合作商处理器工厂
 * </pre>
 * @author zhaojitao
 * @version 1.0, 2015-5-27
 */
public class PartnerProcessorFactory
{
	public static PartnerProcessor getProcessor(ServiceFactory serviceFactory, Partner partner)
	{
		PartnerProcessor processor = null;
		switch (partner.getPartnerType())
		{
			case CHINAPNR:
				processor = new ChinapnrProcessorImpl(serviceFactory, partner);
				break;

			case FUND:
				processor = new FundProcessorImpl(serviceFactory, partner);
				break;
			default:
				throw new RuntimeException("不存在的合作商处理器");
		}
		return processor;
	}
}
